

<!--
You are free to copy and use this sample in accordance with the terms of the
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>
      Google Visualization API Sample
    </title>
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load('visualization', '1', {packages: ['corechart']});
    </script>
    <script type="text/javascript">
       // get the Querystring Function
        function getQuerystring(key, default_) {
            if (default_ == null) default_ = "";
            key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
            var regex = new RegExp("[\\?&]" + key + "=([^&#]*)");
            var qs = regex.exec(window.location.href);
            if (qs == null)
                return default_;
            else
                return qs[1];
        }

		// Read a page's GET URL variables and return them as an associative array.
		function getUrlVars()
		{
		    var vars = [], hash;
		    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

		    for(var i = 0; i < hashes.length; i++)
		    {
		        hash = hashes[i].split('=');
		        vars.push(hash[0]);
		        vars[hash[0]] = hash[1];
		    }

		    return vars;
		}
 
        function drawVisualization() {
	
	    // get the Querystring value and use it in function
	    var authorNames = unescape(window.location.href.slice(window.location.href.indexOf('?') + 1));
		console.log("authorNames = __",authorNames,"__");
		var tmp2 = eval ('(' + authorNames + ')');
		console.log("tmp = __",tmp2.bindings,"__");

		// authorNames=location.href.split("?")rnurlterms=urlquery[1].split(",");
        // Create and populate the data table.
		//         var data = new google.visualization.DataTable();
		// 
		//         data.addColumn('string', 'Task');
		//         data.addColumn('number', 'Hours per Day');
		//         data.addRows(authorNames.length());
		// 
		// for (i = 0; i< authorNames.length(); i++) {
		// 	
		// 	data.setValue(i, 0, authorNames[i]);
		// 	        data.setValue(i, 1, authorCommits[i]);
		// 	        
		// }
		//       
		//         // Create and draw the visualization.
		//         new google.visualization.PieChart(document.getElementById('visualization')).
		//             draw(data, {title:"So, how was your day?"});
      }
      

       google.setOnLoadCallback(drawVisualization);
    </script>
  </head>
  <body style="font-family: Arial;border: 0 none;">
    <div id="visualization" style="width: 600px; height: 400px;"></div>
  </body>
</html>
​